import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizApparchScene = (params) => {
  params.head.transCode = 'queryBizApparchScene';
  return request({
    url: '/biz/apparch/bizApparchScene/queryBizApparchScene',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizApparchSceneListPage = (params) => {
  params.head.transCode = 'queryBizApparchSceneListPage';
  return request({
    url: '/biz/apparch/bizApparchScene/queryBizApparchSceneListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizApparchScene = (params) => {
  params.head.transCode = 'saveBizApparchScene';
  return request({
    url: '/biz/apparch/bizApparchScene/saveBizApparchScene',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizApparchSceneList = (params) => {
  params.head.transCode = 'saveBizApparchSceneList';
  return request({
    url: '/biz/apparch/bizApparchScene/saveBizApparchSceneList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizApparchScene = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchScene';
  return request({
    url: '/biz/apparch/bizApparchScene/saveOrUpdateBizApparchScene',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizApparchSceneList = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchSceneList';
  return request({
    url: '/biz/apparch/bizApparchScene/saveOrUpdateBizApparchSceneList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizApparchScene = (params) => {
  params.head.transCode = 'updateBizApparchScene';
  return request({
    url: '/biz/apparch/bizApparchScene/updateBizApparchScene',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizApparchScene = (params) => {
  params.head.transCode = 'deleteBizApparchScene';
  return request({
    url: '/biz/apparch/bizApparchScene/deleteBizApparchScene',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizApparchSceneList = (params) => {
  params.head.transCode = 'deleteBizApparchSceneList';
  return request({
    url: '/biz/apparch/bizApparchScene/deleteBizApparchSceneList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizApparchSceneExcel = (params) => {
  downloadExcel({
    url: '/biz/apparch/bizApparchScene/excelDownload/exportBizApparchSceneExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
